package com.zdw.oauth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zdw.oauth.entity.RolePermissionEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 角色-权限 Mapper 接口
 * </p>
 *
 * @author 卓德文
 * @since 2023-07-17
 */
public interface RolePermissionMapper extends BaseMapper<RolePermissionEntity> {

    /**
     * 批量新增角色的权限
     * @param roleId
     * @param idList
     * @return
     */
    int saveRolePermissionList(@Param("roleId") Integer roleId, @Param("loginId") Integer loginId, @Param("idList") List<Integer> idList);

    /**
     * 批量删除角色下的权限
     * @param roleId
     * @return
     */
    int deleteRolePermissionByRoleId(@Param("roleId") Integer roleId);
}
